package com.sishu.controller;

import com.sishu.pojo.Game;
import com.sishu.service.GameService;
import com.sishu.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@SuppressWarnings("rawtypes")
@RestController
@Slf4j
@RequestMapping("/teacher/")
@CrossOrigin(origins = "*")
public class TeacherController {

    @Resource
    private GameService gameService;


    /**
     * @author: linyi
     * @date: 2025-01-06 11:37:23
     * @description:开始游戏模块
     */

    @PostMapping("startgame")
    public Result startgame(@RequestBody Game game) {
        log.info("game = " + game);
        return gameService.startgame(game);
    }

    /**
     * @author: linyi
     * @date: 2025-01-06 11:37:34
     * @description:结束游戏模块
     */


    @GetMapping("gameover")
    public Result gameover() {
        return gameService.gameover();
    }

    @GetMapping("seedifficulty")
    public Result seedifficulty() {
        return gameService.seedifficulty();
    }


}
